choices[4] = "Reporting:Build Query:Print Lists:Hunt Duplicates:Create Labels:Write Form Letters:Sum or Average a Field:Field Occurrance"
choices[5] = "Other:List text file:Design Screen Appearance:Change Directory"
choices[6] = "Quit:Quit:Author:Info"
sf_sel = 1.01
*- define menu boxes
PRIVATE boxdata[7]
boxdata[1] = !(ISCOLOR()) && draw the top bar box ?
boxdata[2] = m->c_normcol && top bar color string
boxdata[3] = m->c_popmenu && drop box color
boxdata[4] = m->c_frame && drop box frame
boxdata[5] = 3 && drop box shadow position (1,3,7,9,0)
boxdata[6] = m->c_shadatt && drop box shadow attribute
boxdata[7] = 0 && row # of menu bar
DO WHILE .T.
sf_show() && display dbfs and indexes
*- do the menu
sf_sel = pulldn(m->sf_sel,m->choices,m->boxdata)
*- if 0 returned, selection is QUIT
IF m->sf_sel = 0
m->sf_sel = 6.01
ENDIF
*- do the action corresponding to the menu choice
DO CASE
CASE m->sf_sel = 1.01 && select a DBF
IF Adir('*.dbf') > 0
sf_pickdbf()
ELSE
msg("No DBFs detected in this directory")
ENDIF
CASE m->sf_sel = 1.02 && create structure
IF messyn("Datafiles will be closed while defining new datafile","Continue","Quit",10,10)
modis("C")
CLOSE DATA
isfopen = .F.
dbfname = ''
ENDIF
CASE m->sf_sel = 1.03 && modify structure
IF messyn("Datafiles will be closed while modifying datafile","Continue","Quit",10,10)
modis("M")
CLOSE DATA
isfopen = .F.
dbfname = ''
ENDIF
*- rest of options below 5 require dbf open
CASE m->sf_sel < 5 .AND. !m->isfopen
msg("Need a DBf open for this option")
CASE m->sf_sel = 1.04 && copy records out
copyitout()
CASE m->sf_sel = 1.05 && append records in
sf_append()
CASE m->sf_sel =2.01 && select indices
IF Adir(m->defindex) > 0
sf_picknd()
ENDIF
CASE m->sf_sel = 2.02 .AND. !EMPTY(m->ndx_string) && index order
sf_order() && change index order
CASE m->sf_sel = 2.03 && make temp index
inname = bldndx()
IF !EMPTY(m->inname)
Ains(m->sf_acndx,1) && insert in active index array
sf_acndx[1] = Alltrim(m->inname)+Indexext()
sf_openem() && reopen indexes
ndx_order = 1
ENDIF
CASE m->sf_sel = 3.01 && global replace
globrep()
CASE m->sf_sel = 3.02 && horizontal edit
editdb(.T.)
CASE m->sf_sel = 3.03 && vertical edit
PRIVATE opts[2],procs[2] && build arrays for 'Other' menu
opts[1]="Single Formletter"
opts[2]="Quit"
procs[1] = "FASTFORM"
procs[2] = ""
doitall(m->opts,m->procs)
CASE m->sf_sel = 4.01 && query
query_exp = QUERY()
CASE m->sf_sel = 4.02 && print list
lister()
CASE m->sf_sel = 4.03 && hunt duplicates
duplook()
*- open index files again
sf_openem()
CASE m->sf_sel = 4.04 && labels
clabel()
CASE m->sf_sel = 4.05 && form letter
formletr()
CASE m->sf_sel = 4.06 && sum/AVERAGE
IF messyn("Sum or Average?","Sum","Average")
sum_ave()
ELSE
sum_ave("AVE")
ENDIF
CASE m->sf_sel = 4.07 && occurance
occur()
CASE m->sf_sel = 5.01 && list text file
Fileread()
CASE m->sf_sel = 5.02 && color setting
setcolors()
RESTORE FROM COLORS.MEM ADDIT
SET COLOR TO (m->c_normcol)
paint_sf() && repaint screen
*- redefine menu box data
boxdata[1] = !(ISCOLOR())
boxdata[2] = m->c_normcol
boxdata[3] = m->c_popmenu
boxdata[4] = m->c_frame
boxdata[5] = m->c_shadpos
boxdata[6] = m->c_shadatt
boxdata[7] = 0
CASE m->sf_sel = 5.03 && dir picker
IF fulldir()
CLOSE DATA
isfopen = .F.
query_exp=''
paint_sf()
ENDIF
CASE m->sf_sel = 6.01 && quit
IF messyn('Are you sure?')
SET CURSOR ON
CLEAR
EXIT
ENDIF
CASE m->sf_sel = 6.02
msg(" Super.Lib Library for Clipper","","Written by Garry A Prefontaine","920 N Washington","Edmond, Oklahoma, 73034","(405) 340-1940","Copyright (c) 1989, Garry A Prefontaine")
CASE m->sf_sel = 6.03
msg(" This program was written to demonstrate the capabilities",;
"of the Super.Lib Library for Clipper. The library is available",;